#ifndef _SHADOWMAP_H_
#define _SHADOWMAP_H_

class RenderItemManager;
#include "CDirect3D.h"

class ShadowMap
{
public:
	ShadowMap();
	ShadowMap(const ShadowMap&);
	~ShadowMap();

	void Initialize();
	void Update();
	void Render(XMFLOAT4X4* pViewMatrix, XMFLOAT4X4* pProjectionMatrix);

	ID3D11ShaderResourceView* GetTexture();
private:
	void CreateTexture();

	CDirect3D* mCDirect3D;
	ID3D11DeviceContext* mDeviceContext;
	ID3D11Device* mDevice;

	int mWidth;
	int mHeight;

	ID3D11Texture2D* mTexture;
	ID3D11ShaderResourceView* mTextureRessource;
	ID3D11Texture2D* mTextureDepthBuffer;
	ID3D11DepthStencilView* mStencilViewDepthBuffer;
	ID3D11RenderTargetView* mRenderTargetView;

	D3D11_VIEWPORT mViewportShadow;
};

#endif